package com.ass.rocketmq.constant;

import lombok.AllArgsConstructor;

/**
 * 消息主题
 *
 * @author
 * @since 2023/9/12
 */
@AllArgsConstructor
public enum MQTopic {

    ERROR("死信主题","error","error"),

    DELAY_TIME_LEVEL_ONE("延时消息测试","delay_time_level","delay_one",1),

    ORDER_TRANSACTION_ONE("事务类型的消息","order_transaction","transaction_one"),

    TEST("测试","test","all"),
    TEST1("测试1","test1","cc"),

    MESSAGE_TRACING_ONE("消息回溯测试主题1","message_tracing","message_tracing_one"),
    MESSAGE_TRACING_TWO("消息回溯测试主题2","message_tracing","message_tracing_two")

    ;


    public final String info;
    public final String topic;
    public final String tag;


    //在RocketMQ中，延迟级别从1开始，级别1表示延迟1秒，级别2表示延迟5秒，
    // 级别3表示延迟10秒，以此类推。因此，如果将延迟级别设置为0，实际上就是将消息发送设置为不延迟，即立即发送。
    public final int delayTimeLevel;




    MQTopic(String info, String topic, String tag) {
        this.info = info;
        this.topic = topic;
        this.tag = tag;
        this.delayTimeLevel = 0;
    }
}
